import request from '@/utils/request'

export function findList() {
    return request({
        url: '/menus',
        method: 'get',
    })
}
export function findDetail(id) {
    return request({
        url: '/menus/'+id,
        method: 'get',
    })
}
export function save(data) {
    if(data.id ==null){
        return request({
            url: '/menus',
            method: 'post',
            data: data,
        })
    }else{
        return request({
            url: '/menus/'+data.id,
            method: 'put',
            data: data,
        })
    }
}
export function deleted(id) {
    return request({
        url: '/menus/'+id,
        method: 'delete',
    })
}

export function changeSort(param) {
    return request({
        url: '/menus/changeSort/'+param.id,
        method: 'put',
        params:param
    })
}


